package com.smart.model.convert;

import com.smart.model.dtomapper.DictDtoMapper;
import com.smart.model.domain.DictDO;
import com.smart.model.vo.DictVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DictConvert {

    public static List<DictVO> buildDictVoList(List<DictDO> dictDOList) {
        if (CollectionUtils.isEmpty(dictDOList)) {
            return Lists.newArrayList();
        }
        List<DictVO> dictVOList = new ArrayList<>();
        for (DictDO dictDO : dictDOList) {
            dictVOList.add(DictDtoMapper.INSTANCE.do2VO(dictDO));
        }

        return dictVOList;
    }
}
